package com.ffyc.cemp.schedule;

import org.quartz.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PreHotUsernameConfig {
    /**
     * 任务细节
     * @return
     */
    @Bean
    public JobDetail jobDetail() {

        return JobBuilder.newJob(PreHotUsernameJob.class)
                .storeDurably(true)
                .build();
    }

    /**
     * 时间触发器
     * @return
     */
    @Bean
    public Trigger registryLoadTrigger() {
        return TriggerBuilder.newTrigger()
                .forJob(jobDetail())
                .withSchedule(CronScheduleBuilder.cronSchedule("10 05 14 * * ?"))
                .startNow().
                build();
    }

}
